package dao;

import pojo.Note;
import pojo.User;

import java.sql.SQLException;
import java.util.ArrayList;
import java.util.HashSet;

public interface PageDao {
    /**
     * 总笔记数
     *
     * @return
     * @throws SQLException
     */
    Integer totalNotes() throws SQLException;

    /**
     * 分页查询每页记录--所有笔记
     *
     * @param start
     * @param rows
     * @return
     * @throws SQLException
     * @throws ClassNotFoundException
     */
    ArrayList<Note> list(Integer start, Integer rows) throws SQLException, ClassNotFoundException;

    /**
     * 某区域总笔记数
     *
     * @param type
     * @return
     * @throws SQLException
     */
    Integer areaTotalNotes(String type) throws SQLException;

    /**
     * 分页查询每页记录--区域笔记
     *
     * @param type
     * @param start
     * @param rows
     * @return
     * @throws SQLException
     * @throws ClassNotFoundException
     */
    ArrayList<Note> areaNoteList(String type, Integer start, Integer rows) throws SQLException, ClassNotFoundException;

    /**
     * 某用户总笔记数
     *
     * @param usename
     * @return
     * @throws SQLException
     */
    Integer userTotalNotes(String usename) throws SQLException;

    /**
     * 分页查询每页记录--用户笔记
     *
     * @param usename
     * @param start
     * @param rows
     * @return
     * @throws SQLException
     * @throws ClassNotFoundException
     */
    ArrayList<Note> userNoteList(String usename, Integer start, Integer rows) throws SQLException, ClassNotFoundException;

    /**
     * 某用户待审核总笔记数
     *
     * @param usename
     * @return
     * @throws SQLException
     */
    Integer userCheckedNotes(String usename) throws SQLException;

    /**
     * 分页查询we未被审核的笔记每页记录
     *
     * @param usename
     * @param start
     * @param rows
     * @return
     * @throws SQLException
     * @throws ClassNotFoundException
     */
    ArrayList<Note> userCheckedNoteList(String usename, Integer start, Integer rows) throws SQLException, ClassNotFoundException;

    /**
     * 某用户具体区域总笔记数
     *
     * @param usename
     * @param type
     * @return
     * @throws SQLException
     */
    Integer userTypeNotes(String usename, String type) throws SQLException;

    //    ArrayList<Note> userAreaNoteList(String usename,String type,Integer start,Integer rows);

    /**
     * 某区域未审核总笔记数
     *
     * @param type
     * @return
     * @throws SQLException
     */
    Integer areaTotalCheckedNotes(String type) throws SQLException;

    /**
     * 分页查询每页记录--区域未审核笔记
     *
     * @param areaUsers
     * @param type
     * @param start
     * @param rows
     * @return
     * @throws SQLException
     * @throws ClassNotFoundException
     */
    ArrayList<Note> areaUsersList(HashSet<User> areaUsers, String type, Integer start, Integer rows) throws SQLException, ClassNotFoundException;

    /**
     * 某区域未审核总笔记数
     *
     * @param type
     * @param start
     * @param rows
     * @return
     * @throws SQLException
     * @throws ClassNotFoundException
     */
    ArrayList<Note> areaCheckedNoteList(String type, Integer start, Integer rows) throws SQLException, ClassNotFoundException;

    /**
     * 某区域用户总数
     *
     * @param type
     * @return
     * @throws SQLException
     */
    Integer areaTotalUsers(String type) throws SQLException;

    /**
     * 分页查询每页记录--区域用户
     *
     * @param type
     * @param start
     * @param rows
     * @return
     * @throws SQLException
     * @throws ClassNotFoundException
     */
    ArrayList<User> areaUsersList(String type, Integer start, Integer rows) throws SQLException, ClassNotFoundException;

    /**
     * 搜索后总笔记数
     *
     * @param content
     * @return
     * @throws SQLException
     * @throws ClassNotFoundException
     */
    Integer afterSearchTotalNotes(String content) throws SQLException, ClassNotFoundException;

    /**
     * 搜索后每页记录
     *
     * @param start
     * @param rows
     * @param content
     * @return
     * @throws SQLException
     * @throws ClassNotFoundException
     */
    ArrayList<Note> afterSearchNotesList(Integer start, Integer rows, String content) throws SQLException, ClassNotFoundException;

    /**
     * 精确搜索后总笔记数
     *
     * @param labelSearch
     * @return
     * @throws SQLException
     * @throws ClassNotFoundException
     */
    Integer afterExatSearchTotalNotes(String labelSearch) throws SQLException, ClassNotFoundException;

    /**
     * 精确搜索后每页记录
     *
     * @param start
     * @param rows
     * @param labelSearch
     * @return
     * @throws SQLException
     * @throws ClassNotFoundException
     */
    ArrayList<Note> afterExatSearchNotesList(Integer start, Integer rows, String labelSearch) throws SQLException, ClassNotFoundException;
}
